package com.zzy.service.impl;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
// import org.springframework.transaction.annotation.Transactional;

import com.zzy.model.Files;
import com.zzy.service.FilesService;
/**文件服务的接口的实现*/
// @Transactional
@Service()
public class FilesServiceImpl implements FilesService {

    /*public Files getFilesModelByID(Integer id) {
        String hql="from Files where id=?";
        Object []param=new Object[]{id};
        Files o = basedao.get(hql, param);
        return o;
    }*/
    @Override
    public Files getFilesModelByUID(String uid) {
        String hql="from Files where uid=?";
        Object []param=new Object[]{uid};
        Files o = null;//basedao.get(hql, param);
        return o;
    }
    @Override
    public Files getFilesModelByFID(String fid) {
        String hql="from Files where fid=?";
        Object []param=new Object[]{fid};
        Files o = null;//basedao.get(hql, param);
        return o;
    }
    @Override
    public List<Files> getAllFiles() {
        return null;//basedao.find("from Files");
    }
    @Override
    public Integer delFilesByUID(String uid) {
        Integer i = 1;
        Files o = new Files();
        o=this.getFilesModelByUID(uid);
        try {
            //basedao.delete(o);
        } catch (Exception e) {
            System.out.println("保存失败！");
            i=2;
        }
        return i;
    }
    @Override
    public Integer saveFiles(Files Files) {
        Integer i=1;
        try {
            //basedao.save(Files);
        } catch (Exception e) {
            i=2;
            System.out.println("异常！保存失败！");
        }
        return i;
    }
    @Override
    public Integer upFiles(Files Files) {
        Integer i = 1;
        try {
           // basedao.update( Files);
        } catch (Exception e) {
            System.out.println("保存失败！");
            i=2;
        }
        return i;
    }
    @Override
    public List<Files> getFilesByHql(String hql, Object[] param) {
        return null;//basedao.find(hql, param);
    }
    @Override
    public List<Files> getFilesPage(String hql, Object[] param, Integer page01,
                                    Integer rows01) {
        return null;//basedao.find(hql, param, page01, rows01);
    }
    @Override
    public Integer getTotalNum(String hql, Object[] param) {
        long k = 0L;//basedao.count(hql,param);
        return (int) k;
    }
    @Override
    public Integer saveorupFiles(Files Files) {
        Integer i=1;
        try {
            //basedao.saveOrUpdate(Files);
        } catch (Exception e) {
            i=2;
            System.out.println("异常！保存失败！");
        }
        return i;
    }


}
